#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "./include/sec_demo.h"
#include "./include/pci_dma.h"


void print_hex_dump(void * pdata, int size)
{
	int i;
	unsigned char *p = pdata;
	for(i=0;i<size;i++)
	{
		if(i%16 == 0)
			printf("\n%08x: ",i);
		printf("%02x ",p[i]);
	}
	printf("\n");
}

int main(void)
{
	int ccp903_fd;
    int i;

	ccp903_fd = open("/dev/csec", O_RDWR);
	if(ccp903_fd < 0)
	{
		printf("open dev csec error\n");
		return -1;
	}

    for(i = 0;i < 2;i++)
    {
        printf("*%d\n",i);
	    pci_dma_test(ccp903_fd);
    }

	close(ccp903_fd);
	
    return 0;
}
